﻿namespace MEF_Test
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App
    {
        /// <summary>
        /// Prevents a default instance of the <see cref="App"/> class from being created.         
        /// </summary>
        /// <exception cref="T:System.InvalidOperationException">
        /// More than one instance of the <see cref="T:System.Windows.Application"/> class is created per <see cref="T:System.AppDomain"/>.
        /// </exception>
        private App()
        {
            var bootstrapper = new MydraBootstrapper();
            bootstrapper.Run();


            var regionManager = bootstrapper.RegionManager;
            var localControlsRegion = regionManager.Regions["LocalControls"];
            var view = localControlsRegion.GetView("LocalControlsView");
            if (view == null)
            {
                view = new NavigationPage();
                localControlsRegion.Add(view, "LocalControlsView");
            }
            localControlsRegion.Activate(view);
            //IVideoRenderer videoRenderer = null;
            //regionManager.AddToRegion("SingleMonitorLocalRenderer", videoRenderer);

            //// we define with the help of a mediator, the default module to load.
            // Mediator<LoadModuleMediation>.Publish(
            // new LoadModuleMediation { ModuleUri = new Uri("/WelcomePage.xaml", UriKind.Relative) });
        }
    }
}
